package mjc.egg;
import mjc.tds.*;
import mjc.type.*;
import mjc.gc.*;
import mjc.compiler.*;
import java.util.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
public class S_OPMUL_MJAVA implements IDstNode {
LEX_MJAVA scanner;
  S_OPMUL_MJAVA() {
    }
  S_OPMUL_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    offset = 0;
    length = 0;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  String att_operateur;
  DTYPE att_type;
  LEX_MJAVA att_scanner;
  private void regle58() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_div);
      addChild(x_2);
      action_op11_58();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle57() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_mult);
      addChild(x_2);
      action_op10_57();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle60() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_et);
      addChild(x_2);
      action_op13_60();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle59() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_mod);
      addChild(x_2);
      action_op12_59();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
private void action_op13_60() throws Exception {
try {
// instructions
this.att_operateur="et";
this.att_type= new DTYPE("boolean", 1);
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op10_57() throws Exception {
try {
// instructions
this.att_operateur="mult";
this.att_type= new DTYPE("int", 1);
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op11_58() throws Exception {
try {
// instructions
this.att_operateur="div";
this.att_type= new DTYPE("int", 1);
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op12_59() throws Exception {
try {
// instructions
this.att_operateur="mod";
this.att_type= new DTYPE("int", 1);
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MJAVA.token_mult : // 45480
        regle57 () ;
      break ;
      case LEX_MJAVA.token_div : // 45481
        regle58 () ;
      break ;
      case LEX_MJAVA.token_mod : // 45482
        regle59 () ;
      break ;
      case LEX_MJAVA.token_et : // 45483
        regle60 () ;
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
    private IDstNode parent;
    public void setParent( IDstNode p){parent = p;}
    public IDstNode getParent(){return parent;}
    private List<IDstNode> children = null ;
    public void addChild(IDstNode node){
      if (children == null) {
         children = new ArrayList<IDstNode>() ;}
      children.add(node);
      node.setParent(this);
    }
    public List<IDstNode> getChildren(){return children;}
    public boolean isLeaf(){return children == null;}
    public void accept(IDstVisitor visitor) {
      boolean visitChildren = visitor.visit(this);
      if (visitChildren && children != null){
        for(IDstNode node : children){
          node.accept(visitor);
        }
    }
    visitor.endVisit(this);
  }
  private int offset;
  private int length;
  public int getOffset(){return offset;}
  public void setOffset(int o){offset = o;}
  public int getLength(){return length;}
  public void setLength(int l){length = l;}
  private boolean malformed = false;
  public void setMalformed(){malformed = true;}
  public boolean isMalformed(){return malformed;}
  }
